package com.fourinone.base;

import java.util.Iterator;
import java.util.regex.Pattern;

/**
 * @author szper
 * @version 1.0
 * @date 2019/10/20 12:11
 */
public class MasterObjectVal extends ObjectVal {

    public ObjectVal getNodeWidely (String nodekey) {
        ObjectVal ov = new ObjectVal();
        Object getObj = this.getObj(nodekey);
        if (getObj != null) {
            ov.put(nodekey, this.getObj(nodekey));
            for (Iterator iter = this.keySet().iterator(); iter.hasNext();) {
                String curKey = (String) iter.next();
                if (Pattern.matches(nodekey + "\\..*", curKey)) {
                    ov.put(curKey, this.getObj(curKey));
                }
            }
        }
        return ov;
    }

}
